package cn.dakaqi.entities;

import cn.dakaqi.utils.DKQConstant;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/17.
 * 志愿者公益记录
 */
@Cacheable
@Entity
@Table(name = "U_ACTIVITY_SIGN")
public class ActivitySign extends IdEntity
{
    private Volunteer volunteer;
    private Activity activity;
    private Date createTime;
    private int times;
    private int delStatus;
    private int status;
    private double lng;
    private double lat;
    private int hasCommnet;//是否已被评论
    private int commnetType = DKQConstant.COMMENT_TYPE;//好中差
    private String platform;        //当前公益时间是属于哪些平台的
    private long recordId;//数据提交至北航时返回的在北航库中的公益记录ID

    public long getRecordId()
    {
        return recordId;
    }

    public void setRecordId(long recordId)
    {
        this.recordId = recordId;
    }

    public String getPlatform()
    {
        return platform;
    }

    public void setPlatform(String platform)
    {
        this.platform = platform;
    }

    public int getHasCommnet()
    {
        return hasCommnet;
    }

    public void setHasCommnet(int hasCommnet)
    {
        this.hasCommnet = hasCommnet;
    }

    public int getCommnetType()
    {
        return commnetType;
    }

    public void setCommnetType(int commnetType)
    {
        this.commnetType = commnetType;
    }

    public ActivitySign()
    {
    }

    public ActivitySign(Long id)
    {
        this.id = id;
    }

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "VOLUNTEER_ID")
    public Volunteer getVolunteer()
    {
        return volunteer;
    }

    public void setVolunteer(Volunteer volunteer)
    {
        this.volunteer = volunteer;
    }

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "ACTIVITY_ID")
    public Activity getActivity()
    {
        return activity;
    }

    public void setActivity(Activity activity)
    {
        this.activity = activity;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public int getTimes()
    {
        return times;
    }

    public void setTimes(int times)
    {
        this.times = times;
    }

    public int getDelStatus()
    {
        return delStatus;
    }

    public void setDelStatus(int delStatus)
    {
        this.delStatus = delStatus;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    public double getLng()
    {
        return lng;
    }

    public void setLng(double lng)
    {
        this.lng = lng;
    }

    public double getLat()
    {
        return lat;
    }

    public void setLat(double lat)
    {
        this.lat = lat;
    }
}
